\hypertarget{spi_8h}{
\section{spi.h File Reference}
\label{spi_8h}\index{spi.h@{spi.h}}
}
Various function prototypes and definitions for \hyperlink{spi_8c}{spi.c}.  


{\tt \#include $<$avr/io.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{spi_8h_c2909a28e72d56f28c0ad931c4e565af}{DDR\_\-SPI}~DDRB
\item 
\#define \hyperlink{spi_8h_811601609d4b0f1f6b28d2315e7ed525}{PORT\_\-SPI}~PORTB
\item 
\#define \hyperlink{spi_8h_cb3798a4318e7de0f42a1bde12701f09}{DD\_\-SS}~PB4
\item 
\#define \hyperlink{spi_8h_bbd692ba341a34e06440115b62028ecc}{DD\_\-MOSI}~PB5
\item 
\#define \hyperlink{spi_8h_753ba88bb0fac77be1aedaa84b72bf94}{DD\_\-MISO}~PB6
\item 
\#define \hyperlink{spi_8h_e1c7cea7e1c1279e4b3ce5af14256874}{DD\_\-SCK}~PB7
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{spi_8h_4454f968b2402a0e61deb15ab2571dab}{init\_\-spi} (void)
\begin{CompactList}\small\item\em Initializes the SPI interface by configuring various registers. \item\end{CompactList}\item 
void \hyperlink{spi_8h_0e4372da583445375837a70ca231d30f}{send\_\-byte\_\-to\_\-spi} (uint8\_\-t byte)
\begin{CompactList}\small\item\em Sends a byte through the SPI. \item\end{CompactList}\item 
void \hyperlink{spi_8h_d2841531cdcf8bf06556c0281eb306a1}{send\_\-word\_\-to\_\-spi} (uint16\_\-t word)
\begin{CompactList}\small\item\em Sends a 16bit word via SPI. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Various function prototypes and definitions for \hyperlink{spi_8c}{spi.c}. 

\begin{Desc}
\item[Author:]Peter Kalauskas \end{Desc}
\begin{Desc}
\item[Date:]Feb 1, 2009 \end{Desc}
\begin{Desc}
\item[Version:]1 \end{Desc}


\subsection{Define Documentation}
\hypertarget{spi_8h_753ba88bb0fac77be1aedaa84b72bf94}{
\index{spi.h@{spi.h}!DD\_\-MISO@{DD\_\-MISO}}
\index{DD\_\-MISO@{DD\_\-MISO}!spi.h@{spi.h}}
\subsubsection[{DD\_\-MISO}]{\setlength{\rightskip}{0pt plus 5cm}\#define DD\_\-MISO~PB6}}
\label{spi_8h_753ba88bb0fac77be1aedaa84b72bf94}


The MISO pin for the SPI. \hypertarget{spi_8h_bbd692ba341a34e06440115b62028ecc}{
\index{spi.h@{spi.h}!DD\_\-MOSI@{DD\_\-MOSI}}
\index{DD\_\-MOSI@{DD\_\-MOSI}!spi.h@{spi.h}}
\subsubsection[{DD\_\-MOSI}]{\setlength{\rightskip}{0pt plus 5cm}\#define DD\_\-MOSI~PB5}}
\label{spi_8h_bbd692ba341a34e06440115b62028ecc}


The MOSI pin for the SPI. \hypertarget{spi_8h_e1c7cea7e1c1279e4b3ce5af14256874}{
\index{spi.h@{spi.h}!DD\_\-SCK@{DD\_\-SCK}}
\index{DD\_\-SCK@{DD\_\-SCK}!spi.h@{spi.h}}
\subsubsection[{DD\_\-SCK}]{\setlength{\rightskip}{0pt plus 5cm}\#define DD\_\-SCK~PB7}}
\label{spi_8h_e1c7cea7e1c1279e4b3ce5af14256874}


The SCK pin for the SPI. \hypertarget{spi_8h_cb3798a4318e7de0f42a1bde12701f09}{
\index{spi.h@{spi.h}!DD\_\-SS@{DD\_\-SS}}
\index{DD\_\-SS@{DD\_\-SS}!spi.h@{spi.h}}
\subsubsection[{DD\_\-SS}]{\setlength{\rightskip}{0pt plus 5cm}\#define DD\_\-SS~PB4}}
\label{spi_8h_cb3798a4318e7de0f42a1bde12701f09}


The SS pin for the SPI. \hypertarget{spi_8h_c2909a28e72d56f28c0ad931c4e565af}{
\index{spi.h@{spi.h}!DDR\_\-SPI@{DDR\_\-SPI}}
\index{DDR\_\-SPI@{DDR\_\-SPI}!spi.h@{spi.h}}
\subsubsection[{DDR\_\-SPI}]{\setlength{\rightskip}{0pt plus 5cm}\#define DDR\_\-SPI~DDRB}}
\label{spi_8h_c2909a28e72d56f28c0ad931c4e565af}


Port B pins with alternate functions as shown in Table 13-6, pg. 83

The data direction register for the SPI. \hypertarget{spi_8h_811601609d4b0f1f6b28d2315e7ed525}{
\index{spi.h@{spi.h}!PORT\_\-SPI@{PORT\_\-SPI}}
\index{PORT\_\-SPI@{PORT\_\-SPI}!spi.h@{spi.h}}
\subsubsection[{PORT\_\-SPI}]{\setlength{\rightskip}{0pt plus 5cm}\#define PORT\_\-SPI~PORTB}}
\label{spi_8h_811601609d4b0f1f6b28d2315e7ed525}


The port for the SPI. 

\subsection{Function Documentation}
\hypertarget{spi_8h_4454f968b2402a0e61deb15ab2571dab}{
\index{spi.h@{spi.h}!init\_\-spi@{init\_\-spi}}
\index{init\_\-spi@{init\_\-spi}!spi.h@{spi.h}}
\subsubsection[{init\_\-spi}]{\setlength{\rightskip}{0pt plus 5cm}void init\_\-spi (void)}}
\label{spi_8h_4454f968b2402a0e61deb15ab2571dab}


Initializes the SPI interface by configuring various registers. 

\begin{Desc}
\item[Returns:]void \end{Desc}
\hypertarget{spi_8h_0e4372da583445375837a70ca231d30f}{
\index{spi.h@{spi.h}!send\_\-byte\_\-to\_\-spi@{send\_\-byte\_\-to\_\-spi}}
\index{send\_\-byte\_\-to\_\-spi@{send\_\-byte\_\-to\_\-spi}!spi.h@{spi.h}}
\subsubsection[{send\_\-byte\_\-to\_\-spi}]{\setlength{\rightskip}{0pt plus 5cm}void send\_\-byte\_\-to\_\-spi (uint8\_\-t {\em byte})}}
\label{spi_8h_0e4372da583445375837a70ca231d30f}


Sends a byte through the SPI. 

This function must {\em never\/} be called outside the send\_\-word function.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em byte}]The byte to be sent \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]void \end{Desc}
\hypertarget{spi_8h_d2841531cdcf8bf06556c0281eb306a1}{
\index{spi.h@{spi.h}!send\_\-word\_\-to\_\-spi@{send\_\-word\_\-to\_\-spi}}
\index{send\_\-word\_\-to\_\-spi@{send\_\-word\_\-to\_\-spi}!spi.h@{spi.h}}
\subsubsection[{send\_\-word\_\-to\_\-spi}]{\setlength{\rightskip}{0pt plus 5cm}void send\_\-word\_\-to\_\-spi (uint16\_\-t {\em word})}}
\label{spi_8h_d2841531cdcf8bf06556c0281eb306a1}


Sends a 16bit word via SPI. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em word}]The 16 bit word to be sent. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]void \end{Desc}
